<?php
session_start();

require("includes/selectLanguage.php");
require("includes/constants.php");

if(!isset($_SESSION['userName'])){
	Header("Location: index.html");
	exit();
}
else
{
	$userId = $_SESSION['idUser'];
	$userName = $_SESSION['userName'];
	$userCompleteName = $_SESSION['userCompleteName'];
	$userType = $_SESSION['userType'];
}
?>
<!DOCTYPE HTML>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html" />
	<link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
	<style type="text/css" title="currentStyle">
			@import "js/datatables/css/demo_table_jui.css";
			@import "js/datatables/themes/smoothness/jquery-ui-1.8.4.custom.css";
			@import "css/css.css";
	</style>
	
	<!-- JQuery Script -->
	<script type="text/javascript" src="js/jquery/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.core.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.tabs.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.dialog.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.mouse.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.draggable.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.position.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.resizable.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.autocomplete.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.effects.core.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.effects.blind.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.effects.explode.js"></script>	
	<script type="text/javascript" src="js/jquery/jquery.ui.datepicker.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.validate.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.numeric.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.mousewheel.js"></script>
	<script type="text/javascript" src="js/jquery/jshashtable-2.1.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.numberformatter-1.2.3.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.maskedinput-1.2.2.min.js"></script>
	<script type="text/javascript" src="js/jquery/NumberFormat154.js"></script>
	
	<!-- Data Tables -->
	<script src="js/datatables/js/jquery.dataTables.js" type="text/javascript" ></script>
	<script src="js/datatables/media/js/jquery.jeditable.js" type="text/javascript"></script>
    <script src="js/datatables/media/js/jquery-ui.js" type="text/javascript"></script>
    <script src="js/datatables/media/js/jquery.validate.js" type="text/javascript"></script>
    <script src="js/datatables/media/js/jquery.dataTables.editable.js" type="text/javascript"></script>
    
    <!-- Tools Script -->
    <script src="js/utils.js" type="text/javascript"></script>
</head>

<body>
	<div id="body">
		<!-- Header -->
		<? include_once('layout/header.php');?>
		<? include_once('layout/sidebar.php');?>
		
		<!-- Body -->
		<?
		switch ($_REQUEST['screen']) {								
			case 'foods':
				include_once('foods.php');
				break;
				
			case 'typeFoods':
				include_once('typeFoods.php');
				break;

			case 'recipes':
				include_once('recipes.php');
				break;
				
			case 'tables':
				include_once('tables.php');
				break;

			case 'users':
				include_once('users.php');
				break;
			
			case 'reports':
				include_once('reports.php');
				break;				
			
			case 'restaurants':
				include_once('restaurants.php');
				break;				

			default:
				if($_SESSION['userType'] == $idTypeAdministrator)
					include_once('layout/bodyAdmin.php');
				else
					include_once('layout/body.php');
				break;
		}
		?>
		
		<!-- Footer -->
		<? include_once('layout/footer.php');?>
	</div>
</body>

</html>